CIVIMM-462: Copy payment_instrument_id to instalments#13
Conversation
… instalment Add payment_instrument_id field to RecurringContributionDTO and copy it when creating instalment contributions. This ensures instalments inherit the payment method from the parent recurring contribution as specified in the Recurring-5 requirements.
Summary of ChangesHello @erawat, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where instalment contributions generated by Job 1 were not inheriting the payment instrument ID from their parent recurring contributions. The changes ensure that these generated instalments now correctly carry the associated payment method information, thereby aligning with the Recurring-5 specification requirements. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly adds support for copying the payment_instrument_id from a recurring contribution to its generated instalments. The changes in the RecurringContributionDTO and InstalmentGenerationService are logical and consistent with the existing codebase. However, I've identified a potential issue in the DTO data validation that could be improved for robustness, aligning with best practices for handling critical data. Additionally, as per the repository's style guide, the changes are missing corresponding unit tests to verify the new functionality.
Overview
Ensures instalment contributions inherit the payment method (e.g., Credit Card, Direct Debit) from their parent recurring contribution when generated by Job 1.
Before
Instalment contributions created by the Generate Instalments job did not have a
payment_instrument_id, even when the parent recurring contribution had one set.After
Instalment contributions now inherit
payment_instrument_idfrom the parent recurring contribution, matching the Recurring-5 specification requirements.Technical Details
paymentInstrumentIdproperty toRecurringContributionDTOgetDueRecurringContributions()query to selectpayment_instrument_idcreateInstalment()to copypayment_instrument_idwhen presentCore overrides
None.
Comments
This completes the Job 1 (Generate Instalments) implementation per the Recurring-5 spec.